﻿<%@ WebHandler Language="C#" Class="NewsFeed" %>

using System;
using System.Web;
using System.Web.UI;

using LMD.Constant;
using LMD.Lib.DataClass;
using LMD.Lib.Interface;

public class NewsFeed : IHttpHandler {
    
    String sxOutput = String.Empty;
    
    public void ProcessRequest (HttpContext ctx) {
        String sxAction = ctx.ReadQuery("action");
        String sxID = ctx.ReadQuery("bid");

        try
        {
            switch (sxAction.ToUpper())
            {
                case "BLOCKUSER": DBQuery.NewsFeedTable.BlockNewsFeed_FromUser(sxID); break;
                case "BLOCKCUSTOMER": DBQuery.NewsFeedTable.BlockNewsFeed_FromCustomer(int.Parse(sxID)); break;
            }
        }
        catch(Exception ex)
        {
            sxOutput = ex.Message;
        }

        ctx.Response.ContentType = "text/plain";        
        ctx.Response.Write(sxOutput);
    }

    public bool IsReusable {
        get {
            return false;
        }
    }
    

}